% !TeX encoding = UTF-8 Unicode

% 山东第二医科大学入学与生活指南 © 2023-2025 by LinkChou is licensed under CC BY-SA 4.0. To view a copy of this license, visit https://creativecommons.org/licenses/by-sa/4.0 . Chinese version: https://creativecommons.org/licenses/by-sa/4.0/deed.zh-hans .

% 导入所需的package
\DocumentMetadata{lang=zh-CN,pdfversion=1.7}%hook引入与语言设置
\documentclass[a4paper,twoside,onecolumn,12pt,fontset=none,UTF8]{ctexrep}%ctexreport文档类，fontset=none避免字体冲突警告
%\usepackage{fontspec}%在使用Overleaf编译时取消此行以使字体设置生效，详见ReadMe文件结尾的说明
\usepackage{bxtexlogo}%LaTeX logo（禁止换用hvlogos，因其会重定义部分字体导致报错）
\usepackage{fancyhdr,titlesec}%标题、脚注格式
\usepackage{luacolor, xcolor}%颜色
\usepackage[soul]{lua-ul}%下划线与其他装饰
\usepackage{graphicx}%插入图片
\usepackage{float}%图表位置，如表格过长致横向排版已不可能，应加用adjustboxs宏包排版旋转表格
\usepackage{tabularray}%表格排版
\usepackage{enumitem}%列表排版
\usepackage[a4paper, hmargin=1.5cm, top=1.5cm, bottom=2cm, headheight=0pt, ignorehead]{geometry}%页边距与排版
\usepackage[bookmarksnumbered=true, hidelinks]{hyperref}%超链接
\usepackage{texosquery}%获取秒数及时间
\usepackage{datetime2}%扉页基本时间及格式
%\usepackage{showframe}%显示页面布局与边框，仅Preview版本排查错误

% 设置文档标题
\hypersetup{%
    pdftitle = {山东第二医科大学指南 SDSMU-Companion},%
    pdfauthor = {LinkChou, etc.},%
    pdfdisplaydoctitle = true%
}

% 重设定标题与正文间距
\ctexset{
    chapter={
        beforeskip=0ex,
        afterskip=4ex
    },
    section={
        beforeskip=0ex,
        afterskip=0ex
    },
    subsection={
        beforeskip=0ex,
        afterskip=0ex
    },
    subsubsection={
        beforeskip=0ex,
        afterskip=0ex
    }
}

% 重定义部分logo符号以免冲突
\bxtexlogoimport{LuaTeX}
\bxtexlogoimport{XeLaTeX}
\bxtexlogoimport{XeTeX}

% 重定义文章字体为Noto Serif CJK SC
\setmainfont[CharacterWidth=Proportional,BoldFont=NotoSerifCJKsc-Bold.otf]{NotoSerifCJKsc-Regular.otf}
\setCJKmainfont{NotoSerifCJKsc-Regular.otf}[BoldFont=NotoSerifCJKsc-Bold.otf]
\setCJKsansfont[BoldFont=NotoSerifCJKsc-Bold.otf]{NotoSerifCJKsc-Regular.otf}
\setCJKmonofont[BoldFont=NotoSerifCJKsc-Bold.otf]{NotoSerifCJKsc-Regular.otf}

% 段间距与行间距重设定
\setlength{\parskip}{.75ex plus 5pt minus 8pt}
\setlength{\lineskip}{.5ex plus 5pt minus 8pt}

% 页眉页脚
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[C]{\thepage}

% 脚注格式（无分割线）
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
\renewcommand{\thefootnote}{\fnsymbol{footnote}}

% 列表样式重定义
\setlist[enumerate,1]{
    label=\arabic*.,
    ref=\thesubsubsection-\theenumi
}
\setlist[enumerate,2]{
    label=(\arabic*),
    ref=\thesubsubsection-\theenumi.\theenumii
}
\setlist[enumerate,3]{
    label=[\arabic*],
    ref=\thesubsubsection-\theenumi.\theenumii.\theenumiii
}
\setlist[enumerate,4]{
    label=<\arabic*>,
    ref=\thesubsubsection-\theenumi.\theenumii.\theenumiii.\theenumiv
}
\setlist[enumerate]{
    itemsep=0pt
}

%重定义表格脚注字体大小并增加“no-caption”表格样式
\DefTblrTemplate{note-text}{default}{{\footnotesize\InsertTblrNoteText}}
\DefTblrTemplate{remark-tag}{default}{{\footnotesize\bfseries\InsertTblrRemarkTag}}
\DefTblrTemplate{remark-text}{default}{{\footnotesize\InsertTblrRemarkText}}
\NewTblrTheme{no-caption}{
    \SetTblrTemplate{caption}{empty}
}

%重定义表格表注的表现形式避免问题
\renewcommand\TblrOverlap[1]{#1}

%重定义表格换页时内容
\DefTblrTemplate{contfoot-text}{default}{续下页}
\DefTblrTemplate{conthead-text}{default}{（续）}

% 重定义超链接与引用表现样式
\newcommand{\uhref}[2]{%
    \ul{\href{#1}{#2}}%
}
\newcommand{\uref}[1]{%
    \ul{\ref{#1}}%
}

% 定义下划线样式
\newcommand{\uul}[1]{%
  \ul[bottom=\dimexpr-.7ex+1pt\relax, height=.1ex]{%
    \ul[top=-.7ex, height=.1ex]{%
      #1%
    }%
  }%
}

% 设置校徽命令
\newcommand{\BackgroundPic}{
    \noindent\parbox{\paperwidth}{
        \centering
        \vspace*{400pt}
        \includegraphics[width=5cm]{resources/sundry/logo.pdf}
    }
}

% 颜色重设定
\newcommand{\colored}[4]{
    \textcolor[RGB]{#1,#2,#3}{#4}
}

% 时间样式重设定
\newcommand{\CurrentCustomTime}{
    \DTMsavenow{Compiled_time}%保存编译时间
    \DTMfetchyear{Compiled_time}.%
    \DTMtwodigits{\DTMfetchmonth{Compiled_time}}.%
    \DTMtwodigits{\DTMfetchday{Compiled_time}}\quad%
    \DTMtwodigits{\DTMfetchhour{Compiled_time}}:%
    \DTMtwodigits{\DTMfetchminute{Compiled_time}}:%
    \DTMtwodigits{\DTMfetchsecond{Compiled_time}}\quad%
    GMT\DTMfetchTZhour{Compiled_time}:\DTMfetchTZminute{Compiled_time}
}

\begin{document}

\input{doc_related/preface.tex}%标题、目录

\input{doc_related/special_thanks.tex}%特别感谢
\input{doc_related/document_introduction.tex}%前言

\input{academic_calender/school_calendar.tex}%校历

\input{before_school/content_freshmen_register.tex}%新生报到

\input{in_school/content_fuyanshan.tex}%浮烟山章节
\input{in_school/content_yuhe.tex}%虞河章节

\input{in_school/life/security.tex}%安全

\input{in_school/life/study.tex}%学习方面
\input{in_school/further_education/employment.tex}%就业指引
%\input{in_school/further_education/competition.tex}%???与竞赛

\input{in_school/tutorial/content_generic_tutorials.tex}%通用指南目录

\input{doc_related/epilogue.tex}%后记
\end{document}
